home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Utilities / HyperCard Player 2.3.5 / Power Tools / Power Tools / background_5296.xml < prev    next >
Encoding:
Extensible Markup Language  |  1996-01-09  |  38.1 KB  |  682 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>5296</id>
  5.     <filler1>0</filler1>
  6.     <bitmap>BMAP_5414.pbm</bitmap>
  7.     <cantDelete> <true /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <link rel="stylesheet" type="text/css" href="stylesheet_4895.css" />
  11.     <part>
  12.         <id>3</id>
  13.         <type>field</type>
  14.         <visible> <true /> </visible>
  15.         <dontWrap> <false /> </dontWrap>
  16.         <dontSearch> <false /> </dontSearch>
  17.         <sharedText> <true /> </sharedText>
  18.         <fixedLineHeight> <true /> </fixedLineHeight>
  19.         <autoTab> <false /> </autoTab>
  20.         <lockText> <true /> </lockText>
  21.         <rect>
  22.             <left>22</left>
  23.             <top>30</top>
  24.             <right>262</right>
  25.             <bottom>54</bottom>
  26.         </rect>
  27.         <style>transparent</style>
  28.         <autoSelect> <false /> </autoSelect>
  29.         <showLines> <false /> </showLines>
  30.         <wideMargins> <false /> </wideMargins>
  31.         <multipleLines> <false /> </multipleLines>
  32.         <reservedFamily> 0 </reservedFamily>
  33.         <titleWidth>0</titleWidth>
  34.         <icon>0</icon>
  35.         <textAlign>left</textAlign>
  36.         <font>Helvetica</font>
  37.         <textSize>18</textSize>
  38.         <textStyle>plain</textStyle>
  39.         <textHeight>24</textHeight>
  40.         <name></name>
  41.         <script>on returninfield
  42. end returninfield
  43.  
  44. on closefield
  45. get char 1 to 28 of me
  46. set name of this card to it
  47. end closefield
  48.  
  49. </script>
  50.     </part>
  51.     <part>
  52.         <id>4</id>
  53.         <type>button</type>
  54.         <visible> <true /> </visible>
  55.         <reserved5> 0 </reserved5>
  56.         <reserved4> 0 </reserved4>
  57.         <reserved3> 0 </reserved3>
  58.         <reserved2> 0 </reserved2>
  59.         <reserved1> 0 </reserved1>
  60.         <enabled> <true /> </enabled>
  61.         <rect>
  62.             <left>467</left>
  63.             <top>27</top>
  64.             <right>492</right>
  65.             <bottom>54</bottom>
  66.         </rect>
  67.         <style>transparent</style>
  68.         <showName> <false /> </showName>
  69.         <highlight> <false /> </highlight>
  70.         <autoHighlight> <true /> </autoHighlight>
  71.         <sharedHighlight> <true /> </sharedHighlight>
  72.         <family>0</family>
  73.         <titleWidth>0</titleWidth>
  74.         <icon>18223</icon>
  75.         <textAlign>center</textAlign>
  76.         <font>Geneva</font>
  77.         <textSize>12</textSize>
  78.         <textStyle>plain</textStyle>
  79.         <name></name>
  80.         <script>on mouseUp
  81. lock screen
  82. set cursor to 4
  83. put "Menu Maker Overview" into theFld
  84. show bg fld theFld
  85. set scroll of bg fld theFld to 0
  86. unlock screen with visual barn door open
  87. end mouseUp</script>
  88.     </part>
  89.     <part>
  90.         <id>7</id>
  91.         <type>field</type>
  92.         <visible> <true /> </visible>
  93.         <dontWrap> <true /> </dontWrap>
  94.         <dontSearch> <false /> </dontSearch>
  95.         <sharedText> <false /> </sharedText>
  96.         <fixedLineHeight> <true /> </fixedLineHeight>
  97.         <autoTab> <true /> </autoTab>
  98.         <lockText> <false /> </lockText>
  99.         <rect>
  100.             <left>114</left>
  101.             <top>77</top>
  102.             <right>246</right>
  103.             <bottom>93</bottom>
  104.         </rect>
  105.         <style>transparent</style>
  106.         <autoSelect> <false /> </autoSelect>
  107.         <showLines> <true /> </showLines>
  108.         <wideMargins> <false /> </wideMargins>
  109.         <multipleLines> <false /> </multipleLines>
  110.         <reservedFamily> 0 </reservedFamily>
  111.         <titleWidth>0</titleWidth>
  112.         <icon>0</icon>
  113.         <textAlign>left</textAlign>
  114.         <font>Geneva</font>
  115.         <textSize>9</textSize>
  116.         <textStyle>bold</textStyle>
  117.         <textHeight>12</textHeight>
  118.         <name>MenuTitle</name>
  119.         <script>on closeField
  120. renameFld
  121. end closeField
  122.  
  123. on renameFld
  124. global HCTestMenuHC
  125. if me is HCTestMenuHC then exit renameFld
  126. customMenuDispose
  127. customMenuBuild
  128. end renameFld
  129. </script>
  130.     </part>
  131.     <part>
  132.         <id>14</id>
  133.         <type>button</type>
  134.         <visible> <true /> </visible>
  135.         <reserved5> 0 </reserved5>
  136.         <reserved4> 0 </reserved4>
  137.         <reserved3> 0 </reserved3>
  138.         <reserved2> 0 </reserved2>
  139.         <reserved1> 0 </reserved1>
  140.         <enabled> <true /> </enabled>
  141.         <rect>
  142.             <left>34</left>
  143.             <top>75</top>
  144.             <right>112</right>
  145.             <bottom>90</bottom>
  146.         </rect>
  147.         <style>rectangle</style>
  148.         <showName> <true /> </showName>
  149.         <highlight> <false /> </highlight>
  150.         <autoHighlight> <true /> </autoHighlight>
  151.         <sharedHighlight> <false /> </sharedHighlight>
  152.         <family>0</family>
  153.         <titleWidth>0</titleWidth>
  154.         <icon>0</icon>
  155.         <textAlign>center</textAlign>
  156.         <font>Geneva</font>
  157.         <textSize>9</textSize>
  158.         <textStyle>plain</textStyle>
  159.         <name>Create Menu</name>
  160.         <script>on mouseUp
  161. answer "Replace the existing menu or create a new menu on a new card?"¬¨
  162. with "Replace" or "New Card" or "Cancel" -- ‚àÜ
  163. if it is "Cancel" then exit mouseUp -- ‚àÜ
  164. else if it is "New Card" then
  165. send "doMenu" && quote & "New Card" & quote to HyperCard -- ‚àÜ
  166. else
  167. ask "Enter a new name for the menu:" with bg fld "MenuTitle" -- ‚àÜ
  168. if the result is empty then
  169. put it into bg fld "MenuTitle"
  170. customMenuDispose
  171. customMenuBuild
  172. end if
  173. end if
  174. end mouseUp
  175. </script>
  176.     </part>
  177.     <part>
  178.         <id>15</id>
  179.         <type>field</type>
  180.         <visible> <true /> </visible>
  181.         <dontWrap> <true /> </dontWrap>
  182.         <dontSearch> <false /> </dontSearch>
  183.         <sharedText> <false /> </sharedText>
  184.         <fixedLineHeight> <true /> </fixedLineHeight>
  185.         <autoTab> <true /> </autoTab>
  186.         <lockText> <true /> </lockText>
  187.         <rect>
  188.             <left>34</left>
  189.             <top>141</top>
  190.             <right>246</right>
  191.             <bottom>245</bottom>
  192.         </rect>
  193.         <style>scrolling</style>
  194.         <autoSelect> <false /> </autoSelect>
  195.         <showLines> <false /> </showLines>
  196.         <wideMargins> <true /> </wideMargins>
  197.         <multipleLines> <false /> </multipleLines>
  198.         <reservedFamily> 0 </reservedFamily>
  199.         <titleWidth>0</titleWidth>
  200.         <icon>0</icon>
  201.         <textAlign>left</textAlign>
  202.         <font>Geneva</font>
  203.         <textSize>12</textSize>
  204.         <textStyle>plain</textStyle>
  205.         <textHeight>14</textHeight>
  206.         <name>MenuItems</name>
  207.         <script>on mouseDown
  208. if the value of the clickLine is empty then
  209. beep
  210. answer "Please click on a menu item."
  211. else selectMenuItem word 2 of the clickLine
  212. end mouseDown
  213.  
  214. on lineClear
  215. repeat with count = 1 to number of lines in bg fld "MenuItems"
  216. set textStyle of line count of bg fld "MenuItems" to plain
  217. end repeat
  218. end lineClear
  219. </script>
  220.     </part>
  221.     <part>
  222.         <id>16</id>
  223.         <type>button</type>
  224.         <visible> <true /> </visible>
  225.         <reserved5> 0 </reserved5>
  226.         <reserved4> 0 </reserved4>
  227.         <reserved3> 0 </reserved3>
  228.         <reserved2> 0 </reserved2>
  229.         <reserved1> 0 </reserved1>
  230.         <enabled> <true /> </enabled>
  231.         <rect>
  232.             <left>34</left>
  233.             <top>120</top>
  234.             <right>131</right>
  235.             <bottom>135</bottom>
  236.         </rect>
  237.         <style>rectangle</style>
  238.         <showName> <true /> </showName>
  239.         <highlight> <false /> </highlight>
  240.         <autoHighlight> <true /> </autoHighlight>
  241.         <sharedHighlight> <false /> </sharedHighlight>
  242.         <family>0</family>
  243.         <titleWidth>0</titleWidth>
  244.         <icon>0</icon>
  245.         <textAlign>center</textAlign>
  246.         <font>Geneva</font>
  247.         <textSize>9</textSize>
  248.         <textStyle>plain</textStyle>
  249.         <name>Add a Menu Item</name>
  250.         <script>on mouseUp
  251. global LastLine,HCTestMenuHC
  252. if HCTestMenuHC = empty then send "mouseUp" to bg btn "Create Menu"
  253. ask "Enter the name of the menu item:" with empty -- ‚àÜ
  254. if it is empty or the result is "Cancel" then exit mouseUp -- ‚àÜ
  255. put it into theNewMenuItem
  256. if number of lines in bg field "MenuItems" is zero then
  257. put theNewMenuItem & return into bg field "MenuItems"
  258. put 1 into LastLine
  259. put 1 into theItem
  260. put ",false,false," & return into bg field "MenuItemStuff"
  261. else
  262. answer "Should the new menu item replace or be added before or after the currently" && ¬¨
  263. "selected menu item? Press ‚åò-period to cancel." with "Replace" or "Before" or "After" -- ‚àÜ
  264. if it is "After" then -- ‚àÜ
  265. put theNewMenuItem & return before line (LastLine + 1) of bg field "MenuItems"
  266. put ",false,false," & return before line (LastLine + 1) of bg field "MenuItemStuff"
  267. put (LastLine + 1) into theItem
  268. else if it is "Before" then -- ‚àÜ
  269. if LastLine is 1 then
  270. lock screen
  271. put theNewMenuItem & return before line 1 of bg field "MenuItems"
  272. set textStyle of char 1 to ((number of chars in line 1 of bg field "MenuItems") + 1) of bg field "MenuItems" to plain
  273. put ",false,false," & return before line 1 of bg field "MenuItemStuff"
  274. unlock screen
  275. put 1 into theItem
  276. else
  277. put return & theNewMenuItem after line (LastLine - 1) of bg field "MenuItems"
  278. put return & ",false,false," after line (LastLine - 1) of bg field "MenuItemStuff"
  279. put LastLine into theItem
  280. end if
  281. else if it is "Replace" then -- ‚àÜ
  282. put theNewMenuItem into line LastLine of bg field "MenuItems"
  283. put ",false,false," into line LastLine of bg field "MenuItemStuff"
  284. put LastLine into theItem
  285. end if
  286. end if
  287. put lineSelected() into LastLine
  288. selectMenuItem theItem
  289. if there is no menu HCTestMenuHC then create menu HCTestMenuHC
  290. put bg field "MenuItems" into menu HCTestMenuHC
  291. customMenuUpdateItems
  292. end mouseUp</script>
  293.     </part>
  294.     <part>
  295.         <id>28</id>
  296.         <type>button</type>
  297.         <visible> <true /> </visible>
  298.         <reserved5> 0 </reserved5>
  299.         <reserved4> 0 </reserved4>
  300.         <reserved3> 0 </reserved3>
  301.         <reserved2> 0 </reserved2>
  302.         <reserved1> 0 </reserved1>
  303.         <enabled> <true /> </enabled>
  304.         <rect>
  305.             <left>31</left>
  306.             <top>264</top>
  307.             <right>130</right>
  308.             <bottom>278</bottom>
  309.         </rect>
  310.         <style>checkbox</style>
  311.         <showName> <true /> </showName>
  312.         <highlight> <false /> </highlight>
  313.         <autoHighlight> <false /> </autoHighlight>
  314.         <sharedHighlight> <false /> </sharedHighlight>
  315.         <family>0</family>
  316.         <titleWidth>0</titleWidth>
  317.         <icon>0</icon>
  318.         <textAlign>center</textAlign>
  319.         <font>Geneva</font>
  320.         <textSize>9</textSize>
  321.         <textStyle>plain</textStyle>
  322.         <name>Check Mark</name>
  323.         <script>on mouseUp
  324. global HCTestMenuHC,LastLine
  325. if ((HCTestMenuHC ‚↠empty) and (LastLine > 0)) then
  326. set hilite of me to not hilite of me
  327. if there is no menu HCTestMenuHC then customMenuBuild
  328. if hilite of me then set checkMark of menuItem lineSelected() of menu HCTestMenuHC to true
  329. else set checkMark of menuItem lineSelected() of menu HCTestMenuHC to false
  330. writeState
  331. end if
  332. end mouseUp</script>
  333.     </part>
  334.     <part>
  335.         <id>29</id>
  336.         <type>button</type>
  337.         <visible> <true /> </visible>
  338.         <reserved5> 0 </reserved5>
  339.         <reserved4> 0 </reserved4>
  340.         <reserved3> 0 </reserved3>
  341.         <reserved2> 0 </reserved2>
  342.         <reserved1> 0 </reserved1>
  343.         <enabled> <true /> </enabled>
  344.         <rect>
  345.             <left>31</left>
  346.             <top>249</top>
  347.             <right>130</right>
  348.             <bottom>263</bottom>
  349.         </rect>
  350.         <style>checkbox</style>
  351.         <showName> <true /> </showName>
  352.         <highlight> <false /> </highlight>
  353.         <autoHighlight> <false /> </autoHighlight>
  354.         <sharedHighlight> <false /> </sharedHighlight>
  355.         <family>0</family>
  356.         <titleWidth>0</titleWidth>
  357.         <icon>0</icon>
  358.         <textAlign>center</textAlign>
  359.         <font>Geneva</font>
  360.         <textSize>9</textSize>
  361.         <textStyle>plain</textStyle>
  362.         <name>Disable</name>
  363.         <script>on mouseUp
  364. global HCTestMenuHC,LastLine
  365. if ((HCTestMenuHC ‚↠empty) and (LastLine > 0)) then
  366. set hilite of me to not hilite of me
  367. if there is no menu HCTestMenuHC then customMenuBuild
  368. if hilite of me then disable menuItem lineSelected() of menu HCTestMenuHC
  369. else enable menuItem lineSelected() of menu HCTestMenuHC
  370. writeState
  371. end if
  372. end mouseUp</script>
  373.     </part>
  374.     <part>
  375.         <id>34</id>
  376.         <type>field</type>
  377.         <visible> <true /> </visible>
  378.         <dontWrap> <true /> </dontWrap>
  379.         <dontSearch> <false /> </dontSearch>
  380.         <sharedText> <false /> </sharedText>
  381.         <fixedLineHeight> <true /> </fixedLineHeight>
  382.         <autoTab> <false /> </autoTab>
  383.         <lockText> <true /> </lockText>
  384.         <rect>
  385.             <left>34</left>
  386.             <top>299</top>
  387.             <right>246</right>
  388.             <bottom>317</bottom>
  389.         </rect>
  390.         <style>rectangle</style>
  391.         <autoSelect> <false /> </autoSelect>
  392.         <showLines> <false /> </showLines>
  393.         <wideMargins> <false /> </wideMargins>
  394.         <multipleLines> <false /> </multipleLines>
  395.         <reservedFamily> 0 </reservedFamily>
  396.         <titleWidth>0</titleWidth>
  397.         <icon>0</icon>
  398.         <textAlign>left</textAlign>
  399.         <font>Geneva</font>
  400.         <textSize>12</textSize>
  401.         <textStyle>plain</textStyle>
  402.         <textHeight>16</textHeight>
  403.         <name>MenuMessage</name>
  404.         <script>on mouseUp
  405. addMenuMsg
  406. end mouseUp</script>
  407.     </part>
  408.     <part>
  409.         <id>67</id>
  410.         <type>field</type>
  411.         <visible> <true /> </visible>
  412.         <dontWrap> <true /> </dontWrap>
  413.         <dontSearch> <false /> </dontSearch>
  414.         <sharedText> <false /> </sharedText>
  415.         <fixedLineHeight> <true /> </fixedLineHeight>
  416.         <autoTab> <false /> </autoTab>
  417.         <lockText> <false /> </lockText>
  418.         <rect>
  419.             <left>225</left>
  420.             <top>262</top>
  421.             <right>246</right>
  422.             <bottom>280</bottom>
  423.         </rect>
  424.         <style>rectangle</style>
  425.         <autoSelect> <false /> </autoSelect>
  426.         <showLines> <false /> </showLines>
  427.         <wideMargins> <false /> </wideMargins>
  428.         <multipleLines> <false /> </multipleLines>
  429.         <reservedFamily> 0 </reservedFamily>
  430.         <titleWidth>0</titleWidth>
  431.         <icon>0</icon>
  432.         <textAlign>center</textAlign>
  433.         <font>Chicago</font>
  434.         <textSize>12</textSize>
  435.         <textStyle>plain</textStyle>
  436.         <textHeight>16</textHeight>
  437.         <name>CmdKey</name>
  438.         <script>on closeField
  439. updateField
  440. end closeField
  441.  
  442. on exitField
  443. updateField
  444. end exitField
  445.  
  446. on returnInField
  447. updateField
  448. end returnInField
  449.  
  450. on enterInField
  451. updateField
  452. end enterInField
  453.  
  454. on updateField
  455. global HCTestMenuHC
  456. if HCTestMenuHC ‚↠empty then
  457. put char 1 of me into me
  458. if there is no menu HCTestMenuHC then customMenuBuild
  459. set commandChar of menuItem lineSelected() of menu HCTestMenuHC to me
  460. writeState
  461. end if
  462. end updateField</script>
  463.     </part>
  464.     <part>
  465.         <id>44</id>
  466.         <type>field</type>
  467.         <visible> <true /> </visible>
  468.         <dontWrap> <true /> </dontWrap>
  469.         <dontSearch> <false /> </dontSearch>
  470.         <sharedText> <false /> </sharedText>
  471.         <fixedLineHeight> <true /> </fixedLineHeight>
  472.         <autoTab> <false /> </autoTab>
  473.         <lockText> <false /> </lockText>
  474.         <rect>
  475.             <left>274</left>
  476.             <top>119</top>
  477.             <right>481</right>
  478.             <bottom>317</bottom>
  479.         </rect>
  480.         <style>scrolling</style>
  481.         <autoSelect> <false /> </autoSelect>
  482.         <showLines> <false /> </showLines>
  483.         <wideMargins> <true /> </wideMargins>
  484.         <multipleLines> <false /> </multipleLines>
  485.         <reservedFamily> 0 </reservedFamily>
  486.         <titleWidth>0</titleWidth>
  487.         <icon>0</icon>
  488.         <textAlign>left</textAlign>
  489.         <font>Monaco</font>
  490.         <textSize>9</textSize>
  491.         <textStyle>plain</textStyle>
  492.         <textHeight>12</textHeight>
  493.         <name>Handlers</name>
  494.         <script>
  495. on closeField
  496. end closeField</script>
  497.     </part>
  498.     <part>
  499.         <id>47</id>
  500.         <type>button</type>
  501.         <visible> <true /> </visible>
  502.         <reserved5> 0 </reserved5>
  503.         <reserved4> 0 </reserved4>
  504.         <reserved3> 0 </reserved3>
  505.         <reserved2> 0 </reserved2>
  506.         <reserved1> 0 </reserved1>
  507.         <enabled> <true /> </enabled>
  508.         <rect>
  509.             <left>136</left>
  510.             <top>120</top>
  511.             <right>246</right>
  512.             <bottom>135</bottom>
  513.         </rect>
  514.         <style>rectangle</style>
  515.         <showName> <true /> </showName>
  516.         <highlight> <false /> </highlight>
  517.         <autoHighlight> <true /> </autoHighlight>
  518.         <sharedHighlight> <false /> </sharedHighlight>
  519.         <family>0</family>
  520.         <titleWidth>0</titleWidth>
  521.         <icon>0</icon>
  522.         <textAlign>center</textAlign>
  523.         <font>Geneva</font>
  524.         <textSize>9</textSize>
  525.         <textStyle>plain</textStyle>
  526.         <name>Delete a Menu Item</name>
  527.         <script>on mouseUp
  528. global HCTestMenuHC,LastLine
  529. if LastLine is empty or LastLine is zero then
  530. answer "Please select a menu item to delete first." -- ‚àÜ
  531. exit mouseUp
  532. end if
  533. if the textStyle of line LastLine of bg field "MenuItems" is "bold,underline,condense" then
  534. if the optionKey is not down then
  535. answer "Delete menu item ‚Äú" & line LastLine of bg field "MenuItems" & "‚Äù?" with "Cancel" or "OK" -- ‚àÜ
  536. if it ‚↠"OK" then exit mouseUp -- ‚àÜ
  537. end if
  538. if there is no menu HCTestMenuHC then customMenuBuild
  539. delete line LastLine of bg field "MenuItems"
  540. delete line LastLine of bg field "MenuItemStuff"
  541. delete menuItem LastLine of menu HCTestMenuHC
  542. if ((LastLine - 1) = number of lines in bg field "MenuItems")
  543. then selectMenuItem (Lastline - 1)
  544. else if (number of lines in bg field "MenuItems") > 1 then selectMenuItem LastLine
  545. else set textStyle of line 1 of bg field "MenuItems" to bold,underline,condense
  546. end if
  547. put lineSelected() into LastLine
  548. if LastLine = 0 then
  549. set hilite of bg btn id 29 to false
  550. set hilite of bg btn id 28 to false
  551. put empty into bg field "CmdKey"
  552. put empty into bg field "MenuMessage"
  553. if the number of menuItems of menu HCTestMenuHC > 0 then
  554. delete last menuItem of menu HCTestMenuHC
  555. end if
  556. else
  557. customMenuUpdateItems
  558. end if
  559. end mouseUp</script>
  560.     </part>
  561.     <part>
  562.         <id>48</id>
  563.         <type>field</type>
  564.         <visible> <false /> </visible>
  565.         <dontWrap> <false /> </dontWrap>
  566.         <dontSearch> <false /> </dontSearch>
  567.         <sharedText> <false /> </sharedText>
  568.         <fixedLineHeight> <false /> </fixedLineHeight>
  569.         <autoTab> <false /> </autoTab>
  570.         <lockText> <false /> </lockText>
  571.         <rect>
  572.             <left>4</left>
  573.             <top>0</top>
  574.             <right>490</right>
  575.             <bottom>12</bottom>
  576.         </rect>
  577.         <style>rectangle</style>
  578.         <autoSelect> <false /> </autoSelect>
  579.         <showLines> <false /> </showLines>
  580.         <wideMargins> <false /> </wideMargins>
  581.         <multipleLines> <false /> </multipleLines>
  582.         <reservedFamily> 0 </reservedFamily>
  583.         <titleWidth>0</titleWidth>
  584.         <icon>0</icon>
  585.         <textAlign>left</textAlign>
  586.         <font>Geneva</font>
  587.         <textSize>9</textSize>
  588.         <textStyle>plain</textStyle>
  589.         <textHeight>12</textHeight>
  590.         <name>MenuItemStuff</name>
  591.         <script>on mouseUp
  592. hide me
  593. end mouseUp</script>
  594.     </part>
  595.     <part>
  596.         <id>56</id>
  597.         <type>field</type>
  598.         <visible> <true /> </visible>
  599.         <dontWrap> <false /> </dontWrap>
  600.         <dontSearch> <true /> </dontSearch>
  601.         <sharedText> <true /> </sharedText>
  602.         <fixedLineHeight> <false /> </fixedLineHeight>
  603.         <autoTab> <false /> </autoTab>
  604.         <lockText> <true /> </lockText>
  605.         <rect>
  606.             <left>136</left>
  607.             <top>264</top>
  608.             <right>227</right>
  609.             <bottom>279</bottom>
  610.         </rect>
  611.         <style>transparent</style>
  612.         <autoSelect> <false /> </autoSelect>
  613.         <showLines> <false /> </showLines>
  614.         <wideMargins> <false /> </wideMargins>
  615.         <multipleLines> <false /> </multipleLines>
  616.         <reservedFamily> 0 </reservedFamily>
  617.         <titleWidth>0</titleWidth>
  618.         <icon>0</icon>
  619.         <textAlign>right</textAlign>
  620.         <font>Geneva</font>
  621.         <textSize>9</textSize>
  622.         <textStyle>plain</textStyle>
  623.         <textHeight>12</textHeight>
  624.         <name></name>
  625.         <script>on mouseUp
  626. select text of bg field "CmdKey"
  627. end mouseUp</script>
  628.     </part>
  629.     <part>
  630.         <id>58</id>
  631.         <type>field</type>
  632.         <visible> <true /> </visible>
  633.         <dontWrap> <false /> </dontWrap>
  634.         <dontSearch> <true /> </dontSearch>
  635.         <sharedText> <true /> </sharedText>
  636.         <fixedLineHeight> <true /> </fixedLineHeight>
  637.         <autoTab> <false /> </autoTab>
  638.         <lockText> <true /> </lockText>
  639.         <rect>
  640.             <left>30</left>
  641.             <top>285</top>
  642.             <right>228</right>
  643.             <bottom>300</bottom>
  644.         </rect>
  645.         <style>transparent</style>
  646.         <autoSelect> <false /> </autoSelect>
  647.         <showLines> <false /> </showLines>
  648.         <wideMargins> <false /> </wideMargins>
  649.         <multipleLines> <false /> </multipleLines>
  650.         <reservedFamily> 0 </reservedFamily>
  651.         <titleWidth>0</titleWidth>
  652.         <icon>0</icon>
  653.         <textAlign>left</textAlign>
  654.         <font>Geneva</font>
  655.         <textSize>9</textSize>
  656.         <textStyle>plain</textStyle>
  657.         <textHeight>12</textHeight>
  658.         <name></name>
  659.         <script>on mouseUp
  660. addMenuMsg
  661. end mouseUp</script>
  662.     </part>
  663.     <part>
  664.         <id>59</id>
  665.         <type>field</type>
  666.         <visible> <true /> </visible>
  667.         <dontWrap> <false /> </dontWrap>
  668.         <dontSearch> <false /> </dontSearch>
  669.         <sharedText> <true /> </sharedText>
  670.         <fixedLineHeight> <true /> </fixedLineHeight>
  671.         <autoTab> <false /> </autoTab>
  672.         <lockText> <true /> </lockText>
  673.         <rect>
  674.             <left>262</left>
  675.             <top>62</top>
  676.             <right>495</right>
  677.             <bottom>90</bottom>
  678.         </rect>
  679.         <style>transparent</style>
  680.         <autoSelect> <false /> </autoSelect>
  681.         <showLines> <false /> </showLines>
  682.         <wideMargins> <false /> </wideMargins>
  683.         <multipleLines> <false /> </multipleLines>
  684.         <reservedFamily> 0 </reservedFamily>
  685.         <titleWidth>0</titleWidth>
  686.         <icon>0</icon>
  687.         <textAlign>left</textAlign>
  688.         <font>Geneva</font>
  689.         <textSize>9</textSize>
  690.         <textStyle>plain</textStyle>
  691.         <textHeight>12</textHeight>
  692.         <name></name>
  693.         <script></script>
  694.     </part>
  695.     <part>
  696.         <id>60</id>
  697.         <type>button</type>
  698.         <visible> <true /> </visible>
  699.         <reserved5> 0 </reserved5>
  700.         <reserved4> 0 </reserved4>
  701.         <reserved3> 0 </reserved3>
  702.         <reserved2> 0 </reserved2>
  703.         <reserved1> 0 </reserved1>
  704.         <enabled> <true /> </enabled>
  705.         <rect>
  706.             <left>315</left>
  707.             <top>95</top>
  708.             <right>429</right>
  709.             <bottom>110</bottom>
  710.         </rect>
  711.         <style>rectangle</style>
  712.         <showName> <true /> </showName>
  713.         <highlight> <false /> </highlight>
  714.         <autoHighlight> <true /> </autoHighlight>
  715.         <sharedHighlight> <false /> </sharedHighlight>
  716.         <family>0</family>
  717.         <titleWidth>0</titleWidth>
  718.         <icon>0</icon>
  719.         <textAlign>center</textAlign>
  720.         <font>Geneva</font>
  721.         <textSize>9</textSize>
  722.         <textStyle>plain</textStyle>
  723.         <name>Create Menu Script</name>
  724.         <script>on mouseUp
  725. global gMenuConflict
  726. if (bg fld "MenuTitle" is empty) then
  727. answer "You must first enter a name." -- ‚àÜ
  728. else if (bg fld "MenuItems" is empty) then
  729. answer "Please add some menu items to your menu." -- ‚àÜ
  730. else
  731. ask "Please enter a handler name for the main menu handler:" with "createMenu" -- ‚àÜ
  732. if it is empty or the result is "Cancel" then exit mouseUp -- ‚àÜ
  733. if gMenuConflict is true then answer "This menu conflicted with one of the " & ¬¨
  734. "menus in the menu bar.  You may have to modify this script before it will work." ¬¨
  735. with "OK" -- ‚àÜ
  736. set cursor to watch
  737. put it into mainName
  738. put bg field "MenuTitle" into menuName
  739. put customMenuScript(mainName,menuName) into bg field "Handlers"
  740. set scroll of bg field "Handlers" to zero
  741. select text of bg field "Handlers"
  742. end if
  743. end mouseUp
  744.  
  745. function customMenuScript mainName,menuName
  746. put empty into theHandlers
  747. put mainMenuHandler(mainName,menuName) & return & return after theHandlers
  748. put deleteMenuHandler(mainName,menuName) & return & return after theHandlers
  749. put makeItemsHandler(mainName) & return & return after theHandlers
  750. put makeMsgsHandler(mainName) & return & return after theHandlers
  751. put makeSystemHandlers(mainName) & return & return after theHandlers
  752. return theHandlers
  753. end customMenuScript
  754.  
  755. function mainMenuHandler mainName,menuName
  756. put "-- Please place these handlers" & return & ¬¨ -- ‚àÜ
  757. "-- into your stack script." & return & return & "on" && mainName & return & ¬¨
  758. "if wrongStack() then pass" && mainName & return & ¬¨
  759. "if there is a menu" && quote & menuName & quote && "then exit" && ¬¨
  760. mainName & return & "create menu" && quote & menuName & quote & return & ¬¨
  761. "put" && word 2 of line 1 of makeItemsHandler(mainName) & "()" && ¬¨
  762. "into menu" && quote & menuName & quote && "with menuMsg" && ¬¨
  763. word 2 of line 1 of makeMsgsHandler(mainName) & "()" & return into handlerTxt
  764. put bg field "MenuItemStuff" into menuData
  765. put number of lines in menuData into numDataLines
  766. repeat with count = 1 to numDataLines -- do commandChars
  767. get item 4 of line count of menuData
  768. if it ‚↠empty then put "set commandChar of menuItem" && count && "of menu" && quote & menuName & quote && ¬¨
  769. "to" && quote & it & quote & return after handlerTxt
  770. end repeat
  771. repeat with count = 1 to numDataLines -- do checkMarks
  772. if item 3 of line count of menuData
  773. then put "set checkMark of menuItem" && count && "of menu" && quote & menuName & quote && ¬¨
  774. "to true" & return after handlerTxt
  775. end repeat
  776. repeat with count = 1 to numDataLines -- do disabled
  777. if item 2 of line count of menuData
  778. then put "disable menuItem" && count && "of menu" && quote & menuName & quote ¬¨
  779. & return after handlerTxt
  780. end repeat
  781. put "end" && mainName after handlerTxt
  782. return handlerTxt
  783. pass mainMenuHandler
  784. end mainMenuHandler
  785.  
  786. function deleteMenuHandler mainName,menuName
  787. return "on un" & mainName & return & ¬¨
  788. "if wrongStack() then pass un" & mainName & return & ¬¨
  789. "if there is not a menu" && quote & ¬¨
  790. menuName & quote && "then exit" && ¬¨
  791. "un" & mainName & return & ¬¨
  792. "else delete menu" && quote & ¬¨
  793. menuName & quote & return & ¬¨
  794. "end un" & mainName
  795. pass deleteMenuHandler
  796. end deleteMenuHandler
  797.  
  798. function makeItemsHandler mainName
  799. put mainName & "Items" into myName
  800. put number of lines in bg field "MenuItems" into numLines
  801. put "function" && myName & return & ¬¨
  802. "if wrongStack() then pass" && myName & return & "return" into handlerTxt
  803. repeat with i = 1 to numLines
  804. put space & quote & line i of bg field "MenuItems" & quote after handlerTxt
  805. if i ‚↠numLines then put " & return & ¬¨" & return after handlerTxt
  806. end repeat
  807. put return & "end" && myName after handlerTxt
  808. return handlerTxt
  809. pass makeItemsHandler
  810. end makeItemsHandler
  811.  
  812. function makeMsgsHandler mainName
  813. put mainName & "Msgs" into myName
  814. put empty into theMsgs
  815. put the number of lines in bg field "MenuItemStuff" into numLines
  816. put "function" && myName & return & ¬¨
  817. "if wrongStack() then pass" && myName & return & "return" into handlerTxt
  818. repeat with count = 1 to numLines
  819. get item 1 of line count of bg field "MenuItemStuff"
  820. if quote is in it then
  821. put empty into tempTxt
  822. put false into isQuote
  823. repeat with count = 1 to number of chars in it
  824. if char count of it ‚↠quote
  825. then put char count of it after tempTxt
  826. else
  827. if isQuote then
  828. put quote & tempTxt & quote && "& quote & " after handlerTxt
  829. put false into isQuote
  830. else
  831. put quote & tempTxt & quote && "& quote & " after handlerTxt
  832. put true into isQuote
  833. end if
  834. put empty into tempTxt
  835. end if
  836. end repeat
  837. put "return & " after handlerTxt
  838. else put quote & it & quote && "& return & " after handlerTxt
  839. if count ‚↠numLines then put "¬¨" & return after handlerTxt
  840. end repeat
  841. repeat until last word of handlerTxt is not in "&,¬¨,return"
  842. delete last word of handlerTxt
  843. end repeat
  844. if last char of handlerTxt is quote then put return after handlerTxt
  845. put "end" && myName after handlerTxt
  846. return handlerTxt
  847. pass makeMsgsHandler
  848. end makeMsgsHandler
  849.  
  850. function makeSystemHandlers mainName
  851. return "function wrongStack" & return & ¬¨
  852. "get the value of word 2 of the long name of me" & return & ¬¨
  853. "return (it is not line 1 of the stacks)" & return & ¬¨
  854. "end wrongStack" & return & return & ¬¨
  855. "on openStack" & return & ¬¨
  856. "if wrongStack() then pass openStack" & return & ¬¨
  857. mainName & return & ¬¨
  858. "pass openStack" & return & ¬¨
  859. "end openStack" & return & return & ¬¨
  860. "on closeStack" & return & ¬¨
  861. "if wrongStack() then pass closeStack" & return & ¬¨
  862. "un" & mainName & return & ¬¨
  863. "pass closeStack" & return & ¬¨
  864. "end closeStack" & return & return & ¬¨
  865. "on resume" & return & ¬¨
  866. "if wrongStack() then pass resume" & return & ¬¨
  867. mainName & return & ¬¨
  868. "pass resume" & return & ¬¨
  869. "end resume" & return & return & ¬¨
  870. "on suspend" & return & ¬¨
  871. "if wrongStack() then pass suspend" & return & ¬¨
  872. "un" & mainName & return & ¬¨
  873. "pass suspend" & return & ¬¨
  874. "end suspend" & return & return & ¬¨
  875. "on resumeStack" & return & ¬¨
  876. "if wrongStack() then pass resumeStack" & return & ¬¨
  877. mainName & return & ¬¨
  878. "pass resumeStack" & return & ¬¨
  879. "end resumeStack" & return & return & ¬¨
  880. "on suspendStack" & return & ¬¨
  881. "if wrongStack() then pass suspendStack" & return & ¬¨
  882. "un" & mainName & return & ¬¨
  883. "pass suspendStack" & return & ¬¨
  884. "end suspendStack"
  885. pass makeSystemHandlers
  886. end makeSystemHandlers
  887. </script>
  888.     </part>
  889.     <part>
  890.         <id>61</id>
  891.         <type>field</type>
  892.         <visible> <true /> </visible>
  893.         <dontWrap> <false /> </dontWrap>
  894.         <dontSearch> <true /> </dontSearch>
  895.         <sharedText> <true /> </sharedText>
  896.         <fixedLineHeight> <true /> </fixedLineHeight>
  897.         <autoTab> <false /> </autoTab>
  898.         <lockText> <true /> </lockText>
  899.         <rect>
  900.             <left>18</left>
  901.             <top>62</top>
  902.             <right>245</right>
  903.             <bottom>76</bottom>
  904.         </rect>
  905.         <style>transparent</style>
  906.         <autoSelect> <false /> </autoSelect>
  907.         <showLines> <false /> </showLines>
  908.         <wideMargins> <false /> </wideMargins>
  909.         <multipleLines> <false /> </multipleLines>
  910.         <reservedFamily> 0 </reservedFamily>
  911.         <titleWidth>0</titleWidth>
  912.         <icon>0</icon>
  913.         <textAlign>left</textAlign>
  914.         <font>Geneva</font>
  915.         <textSize>9</textSize>
  916.         <textStyle>plain</textStyle>
  917.         <textHeight>12</textHeight>
  918.         <name></name>
  919.         <script></script>
  920.     </part>
  921.     <part>
  922.         <id>62</id>
  923.         <type>field</type>
  924.         <visible> <true /> </visible>
  925.         <dontWrap> <false /> </dontWrap>
  926.         <dontSearch> <true /> </dontSearch>
  927.         <sharedText> <true /> </sharedText>
  928.         <fixedLineHeight> <true /> </fixedLineHeight>
  929.         <autoTab> <false /> </autoTab>
  930.         <lockText> <true /> </lockText>
  931.         <rect>
  932.             <left>20</left>
  933.             <top>103</top>
  934.             <right>257</right>
  935.             <bottom>117</bottom>
  936.         </rect>
  937.         <style>transparent</style>
  938.         <autoSelect> <false /> </autoSelect>
  939.         <showLines> <false /> </showLines>
  940.         <wideMargins> <false /> </wideMargins>
  941.         <multipleLines> <false /> </multipleLines>
  942.         <reservedFamily> 0 </reservedFamily>
  943.         <titleWidth>0</titleWidth>
  944.         <icon>0</icon>
  945.         <textAlign>left</textAlign>
  946.         <font>Geneva</font>
  947.         <textSize>9</textSize>
  948.         <textStyle>plain</textStyle>
  949.         <textHeight>12</textHeight>
  950.         <name></name>
  951.         <script></script>
  952.     </part>
  953.     <part>
  954.         <id>66</id>
  955.         <type>field</type>
  956.         <visible> <false /> </visible>
  957.         <dontWrap> <false /> </dontWrap>
  958.         <dontSearch> <true /> </dontSearch>
  959.         <sharedText> <true /> </sharedText>
  960.         <fixedLineHeight> <false /> </fixedLineHeight>
  961.         <autoTab> <false /> </autoTab>
  962.         <lockText> <true /> </lockText>
  963.         <rect>
  964.             <left>12</left>
  965.             <top>23</top>
  966.             <right>500</right>
  967.             <bottom>329</bottom>
  968.         </rect>
  969.         <style>scrolling</style>
  970.         <autoSelect> <false /> </autoSelect>
  971.         <showLines> <false /> </showLines>
  972.         <wideMargins> <true /> </wideMargins>
  973.         <multipleLines> <false /> </multipleLines>
  974.         <reservedFamily> 0 </reservedFamily>
  975.         <titleWidth>0</titleWidth>
  976.         <icon>0</icon>
  977.         <textAlign>left</textAlign>
  978.         <font>Palatino</font>
  979.         <textSize>12</textSize>
  980.         <textStyle>plain</textStyle>
  981.         <textHeight>16</textHeight>
  982.         <name>Menu Maker Overview</name>
  983.         <script>on mouseUp
  984. lock screen
  985. hide me
  986. unlock screen with visual barn door close
  987. end mouseUp</script>
  988.     </part>
  989.     <content>
  990.         <layer>background</layer>
  991.         <id>3</id>
  992.         <text><span class="style34">enu Maker</span></text>
  993.     </content>
  994.     <content>
  995.         <layer>background</layer>
  996.         <id>61</id>
  997.         <text>1. Click Create Menu to enter a menu name.</text>
  998.     </content>
  999.     <content>
  1000.         <layer>background</layer>
  1001.         <id>62</id>
  1002.         <text>2. Add menu items and their menu messages.</text>
  1003.     </content>
  1004.     <content>
  1005.         <layer>background</layer>
  1006.         <id>56</id>
  1007.         <text>Command Key:</text>
  1008.     </content>
  1009.     <content>
  1010.         <layer>background</layer>
  1011.         <id>58</id>
  1012.         <text>Click to edit current menu message:</text>
  1013.     </content>
  1014.     <content>
  1015.         <layer>background</layer>
  1016.         <id>59</id>
  1017.         <text>3. Click Create Menu Script and paste the 
  1018.     resulting handlers into your stack script.</text>
  1019.     </content>
  1020.     <content>
  1021.         <layer>background</layer>
  1022.         <id>66</id>
  1023.         <text><span class="style1517">About the Menu Maker</span><span class="style1520">
  1024. </span><span class="style31">
  1025. </span><span class="style21">‚Ä¢ Click this field to hide it.
  1026. ‚Ä¢ To print this field, choose Print Field from the File menu.
  1027.  
  1028. The Menu Maker allows you to build a menu, set the attributes for each menu item, and it updates the menu in the menu bar as you add items. When you‚Äôre finished, Menu Maker will generate the HyperTalk handlers that create the menu. You can then copy and paste these handlers into another stack.
  1029.  
  1030. To create a menu with Menu Maker, follow these steps:
  1031.  
  1032. 1. By clicking Create Menu in box 1: You can name your new menu and specify 
  1033.     whether you want your new menu to replace an existing one or start on a  
  1034.     new card.
  1035.  
  1036. 2. Add menu items to the menu by clicking Add a Menu Item in box 2. If you‚Äôve 
  1037.     already added other menu items, Menu Maker asks you where to place the new 
  1038.     item. To reorder menu items, click any item in the list to select it. Then click 
  1039.     Delete a Menu Item or Add a Menu Item.
  1040.  
  1041. 3. Click any menu item in the list to select it. Then set its attributes: 
  1042.     ‚Ä¢ Click the Disable check box to dim the menu item;  
  1043.     ‚Ä¢ Click the CheckMark check box to place a check mark before the item; 
  1044.     ‚Ä¢ Type a character as the Command key equivalent for the item; or 
  1045.     ‚Ä¢ Enter a HyperTalk statement that HyperCard will send as a message to the 
  1046.        current card when the user chooses the item.
  1047.  
  1048. 4. To generate the HyperTalk handlers, click Create Menu Script in box 3. Then 
  1049.     copy and paste the handlers from the field to your stack.
  1050.  
  1051. Note: To specify a menu separator (gray line), type a hyphen ("-") for the name of the menu item and click the Disable check box to select it. If your menu‚Äôs name matches the name of an existing menu, Menu Maker displays it with a ‚Äú‚óä‚Äù prepended to the name; however, the handlers generated use the name you entered.
  1052. </span></text>
  1053.     </content>
  1054.     <name>Menu Maker</name>
  1055.     <script>‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû
  1056. Script from background of Menu Maker in stack Power Tools
  1057.  
  1058. THE MESSAGE HANDLERS USED IN THIS SCRIPT:
  1059. openCard,closeCard,returnKey,updateTheMenu,makeNewMenu,selectMenuItem
  1060. addMenuMsg,writeState,clearMenu,doMenu
  1061.  
  1062. THE FUNCTION HANDLERS USED IN THIS SCRIPT:
  1063. lineSelected
  1064. ‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû
  1065.  
  1066. on customMenuDispose
  1067. global HCTestMenuHC, LastLine, gMenuConflict
  1068. if there is a menu HCTestMenuHC then delete menu HCTestMenuHC
  1069. put empty into HCTestMenuHC
  1070. put empty into LastLine
  1071. put empty into gMenuConflict
  1072. end customMenuDispose
  1073.  
  1074. on customMenuBuild
  1075. global HCTestMenuHC, LastLine
  1076. put lineSelected() into LastLine
  1077. put CustomMenuName() into HCTestMenuHC
  1078. create menu HCTestMenuHC
  1079. customMenuAddItems
  1080. end customMenuBuild
  1081.  
  1082. function CustomMenuName  -- returns name of custom menu, modifying it, if nec.
  1083. global gMenuConflict
  1084. put bg field "MenuTitle" into menuName
  1085. if menuName is empty then put "Untitled" into menuName
  1086. if there is a menu menuName then
  1087. repeat until (there is no menu menuName)
  1088. put "‚óä" before menuName
  1089. end repeat
  1090. put true into gMenuConflict
  1091. end if
  1092. return menuName
  1093. end CustomMenuName
  1094.  
  1095. on customMenuAddItems
  1096. global HCTestMenuHC
  1097. if bg field "MenuItems" ‚↠empty then
  1098. put bg field "MenuItems" into menu HCTestMenuHC
  1099. end if
  1100. customMenuUpdateItems
  1101. end customMenuAddItems
  1102.  
  1103. on customMenuUpdateItems
  1104. global HCTestMenuHC
  1105. put bg field "MenuItemStuff" into menuItemInfo
  1106. repeat with count = 1 to the number of lines in menuItemInfo
  1107. set menuMsg of menuItem count of menu HCTestMenuHC to ¬¨
  1108. item 1 of line count of menuItemInfo
  1109. set enabled of menuItem count of menu HCTestMenuHC to ¬¨
  1110. not (item 2 of line count of menuItemInfo)
  1111. set checkMark of menuItem count of menu HCTestMenuHC to ¬¨
  1112. item 3 of line count of menuItemInfo
  1113. set commandChar of menuItem count of menu HCTestMenuHC to ¬¨
  1114. item 4 of line count of menuItemInfo
  1115. end repeat
  1116. end customMenuUpdateItems
  1117.  
  1118. -- MESSAGES FROM HYPERCARD --------------------------------------------
  1119.  
  1120. on openCard
  1121. customMenuBuild
  1122. pass openCard
  1123. end openCard
  1124.  
  1125. on closeCard
  1126. customMenuDispose
  1127. hideOverview
  1128. pass closeCard
  1129. end closeCard
  1130.  
  1131. on suspendStack
  1132. customMenuDispose
  1133. hideOverview
  1134. pass suspendStack
  1135. end suspendStack
  1136.  
  1137. on resumeStack
  1138. customMenuBuild
  1139. pass resumeStack
  1140. end resumeStack
  1141.  
  1142. on newCard
  1143. ask "Please enter a name for your custom menu:" with "Untitled"
  1144. if the result is not empty then -- user canceled
  1145. lock screen
  1146. lock messages
  1147. send "doMenu" && quote & "Delete Card" & quote to HyperCard
  1148. go back
  1149. unlock messages
  1150. unlock screen
  1151. else
  1152. put it into bg field "MenuTitle"  -- might be empty
  1153. end if
  1154. end newCard
  1155.  
  1156. on returnKey
  1157. -- A 'return' is a shortcut for adding a new menu item.
  1158. if the message box is not empty then pass returnKey
  1159. if (the selectedField is empty) then send "mouseUp" to bg btn id 16
  1160. else pass returnKey
  1161. end returnKey
  1162.  
  1163. on doMenu whichItem,whichMenu
  1164. global HCTestMenuHC
  1165. if whichMenu is HCTestMenuHC then
  1166. put the menuMsg of menuItem whichItem of menu HCTestMenuHC into theMsg
  1167. if theMsg is empty then put "<No menu message>" into theMsg -- ‚àÜ
  1168. answer "Menu:" && whichMenu & return & "Menu message:" && theMsg -- ‚àÜ
  1169. else pass doMenu
  1170. end doMenu
  1171.  
  1172. -- UTILITIES ----------------------------------------------------------
  1173.  
  1174. function lineSelected
  1175. put 0 into count
  1176. repeat with count = 1 to number of lines in bg field "MenuItems"
  1177. if (textStyle of line count of bg field "MenuItems") ‚↠plain then exit repeat
  1178. end repeat
  1179. return count
  1180. end lineSelected
  1181.  
  1182. on selectMenuItem theLine
  1183. global LastLine
  1184. if ((LastLine ‚↠empty) and (LastLine ‚↠0)) then
  1185. set textStyle of line LastLine of bg field "MenuItems" to plain
  1186. set textStyle of line theLine of bg field "MenuItems" to bold,underline,condense
  1187. put line theLine of bg field "MenuItemStuff" into theState
  1188. put item 1 of theState into bg field "MenuMessage"
  1189. put item 4 of theState into bg field "CmdKey"
  1190. if theState ‚↠empty then
  1191. set hilite of bg btn id 29 to item 2 of theState
  1192. set hilite of bg btn id 28 to item 3 of theState
  1193. end if
  1194. put theLine into LastLine
  1195. end if
  1196. end selectMenuItem
  1197.  
  1198. on addMenuMsg
  1199. global HCTestMenuHC
  1200. put lineSelected() into theMenuItem
  1201. if ((theMenuItem = empty) or (theMenuItem = 0)) then
  1202. answer "Please select a menu item first." -- ‚àÜ
  1203. exit addMenuMsg
  1204. end if
  1205. ask "Enter the menu message:" with bg field "MenuMessage" -- ‚àÜ
  1206. if the result is "Cancel" then exit addMenuMsg -- ‚àÜ
  1207. put it into bg field "MenuMessage"
  1208. writeState it
  1209. if there is no menu HCTestMenuHC then
  1210. create menu HCTestMenuHC
  1211. put bg field "MenuItems" into menu HCTestMenuHC
  1212. end if
  1213. customMenuUpdateItems
  1214. end addMenuMsg
  1215.  
  1216. on writeState theMenuMsg
  1217. put empty into theState
  1218. put lineSelected() into theMenuItem
  1219. put bg field "CmdKey" into item 4 of theState
  1220. put hilite of bg btn id 28 into item 3 of theState
  1221. put hilite of bg btn id 29 into item 2 of theState
  1222. put item 1 of line theMenuItem of bg field "MenuItemStuff" into item 1 of theState
  1223. put theMenuMsg into item 1 of theState
  1224. put theState into line theMenuItem of bg field "MenuItemStuff"
  1225. end writeState
  1226.  
  1227. on clearMenu
  1228. global HCTestMenuHC,LastLine,gMenuConflict
  1229. if there is a menu HCTestMenuHC then
  1230. lock screen
  1231. delete menu HCTestMenuHC
  1232. put empty into bg fld "MenuTitle"
  1233. put empty into bg fld "MenuItems"
  1234. put empty into bg fld "MenuMessage"
  1235. put empty into bg fld "Handlers"
  1236. put empty into bg field "CmdKey"
  1237. put empty into bg field "MenuItemStuff"
  1238. put empty into bg field "MenuConflict"
  1239. set hilite of bg btn id 29 to false
  1240. set hilite of bg btn id 28 to false
  1241. put empty into HCTestMenuHC
  1242. put 0 into LastLine
  1243. put empty into gMenuConflict
  1244. unlock screen
  1245. end if
  1246. end clearMenu
  1247.  
  1248. on hideOverview
  1249. lock screen
  1250. put "Menu Maker Overview" into theField
  1251. hide bg field theField
  1252. unlock screen
  1253. end hideOverview
  1254. </script>
  1255. </background>
  1256.